import { http } from "@/utils/http";

//登录
export const WebLogin = (data?: object) => {
  return http.request("post", `/api/User/WebLogin`, { data });
};

//分页查询用户手环信息
export const GetDevicesWithPaging = (data?: object) => {
  return http.request("post", `/api/Device/GetDevicesWithPaging`, {
    data
  });
};
//分页查询所有设备
export const GetDevices = (data?: object) => {
  return http.request("post", `/api/Device/GetDevices`, {
    data
  });
};
//分页查询用户心率信息
export const PaginFindHeartRateAndLocationByTimeRange = (data?: object) => {
  return http.request(
    "post",
    `/api/Device/PaginFindHeartRateAndLocationByTimeRange`,
    { data }
  );
};
// 分页查询所有用户
export const GetAllUsersByPaging = (data?: object) => {
  return http.request("post", `/api/User/GetAllUsersByPaging`, { data });
};
//根据用户id查询对应用户的电子围栏
export const GetElectronicFence = (data?: object) => {
  return http.request("post", `/api/ElectronicFence/GetElectronicFence`, {
    data
  });
};
//根据经纬度返回用户的当前位置
export const GetLocationDetailsAsync = (data?: object) => {
  return http.request("post", `/api/Device/GetLocationDetailsAsync`, {
    data
  });
};
//新增对应用户电子围栏
export const CreateElectronicFence = (data?: object) => {
  return http.request("post", `/api/ElectronicFence/CreateElectronicFence`, {
    data
  });
};

//删除电子围栏
export const DeleteElectronicFence = (data?: object) => {
  return http.request("post", `/api/ElectronicFence/DeleteElectronicFence`, {
    data
  });
};

//分页查询异常警报
export const PagingWarningNoticeForAllUsers = (data?: object) => {
  return http.request("post", `/api/Notice/PagingWarningNoticeForAllUsers`, {
    data
  });
};

// 分页查询所有病患信息
export const PaginFindDeagnosticLogout = (data?: object) => {
  return http.request(
    "post",
    `/api/PatientInformation/PaginFindIllnessMessages`,
    { data }
  );
};
//根据病患ID查询病患信息表
export const FindIllnessMessageDetail = (data?: object) => {
  return http.request(
    "post",
    `/api/PatientInformation/FindIllnessMessageDetail`,
    { data }
  );
};
//修改病患信息表
export const UpdateIllnessMessage = (data?: object) => {
  return http.request("post", `/api/PatientInformation/UpdateIllnessMessage`, {
    data
  });
};
//新增病患信息表
export const AddIllnessMessage = (data?: object) => {
  return http.request("post", `/api/PatientInformation/AddIllnessMessage`, {
    data
  });
};
//删除病患信息标
export const DeleteIllnessMessage = (data?: object) => {
  return http.request("post", `/api/PatientInformation/DeleteIllnessMessage`, {
    data
  });
};
// 分页查询复诊随访记录
export const PaginFindRevisitRecords = (data?: object) => {
  return http.request(
    "post",
    `/api/PatientInformation/PaginFindRevisitRecords`,
    { data }
  );
};

// 分页查询应激记录
export const PaginFindStressRecords = (data?: object) => {
  return http.request(
    "post",
    `/api/PatientInformation/PaginFindStressRecords`,
    { data }
  );
};
// 分页查询用药信息
export const PaginFindDrugRecords = (data?: object) => {
  return http.request("post", `/api/PatientInformation/PaginFindDrugRecords`, {
    data
  });
};

//绑定手环
export const BindingBracelet = (data?: object) => {
  return http.request("post", `/api/Device/BindingBracelet`, {
    data
  });
};

//解绑手环
export const UnbindBracelet = (data?: object) => {
  return http.request("post", `/api/Device/UnbindBracelet`, {
    data
  });
};

//后台新增用户
export const WebInsertUser = (data?: object) => {
  return http.request("post", `/api/User/WebInsertUser`, {
    data
  });
};

//设置手环频率
export const UpdateFrequency = (data?: object) => {
  return http.request("post", `/api/Device/UpdateFrequency`, {
    data
  });
};

//设置用户异常判定
export const UpdateUserConfigurationInformation = (data?: object) => {
  return http.request("post", `/api/User/UpdateUserConfigurationInformation`, {
    data
  });
};

//模糊查询设备号
export const GetUnboundDeviceNos = (data?: object) => {
  return http.request("post", `/api/Device/GetUnboundDeviceNos`, {
    data
  });
};
//查询特定时间段内用户路径
export const FindTrajectory = (data?: object) => {
  return http.request("post", `/api/Device/FindTrajectory`, {
    data
  });
}; 
//查询用户七天步数
export const FindUserStepsOnWeb = (data?: object) => {
  return http.request("post", `/api/Device/FindUserStepsOnWeb`, {
    data
  });
};